<?php 
echo md5("cinfo_1");
require_once('../Connections/conn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_conn, $conn);
$query_rs_gal = "SELECT categoryid,parentid, categoryname FROM category";
$rs_gal = mysql_query($query_rs_gal, $conn) or die(mysql_error());
$row_rs_gal = mysql_fetch_assoc($rs_gal);
$totalRows_rs_gal = mysql_num_rows($rs_gal);
$ar =array();
$cnt=0;
?>
  <?php do 
  			{
	$ar[$cnt] = array("id"=>$row_rs_gal['categoryid'],"cname"=>$row_rs_gal['categoryname'],"parent"=>$row_rs_gal['parentid']);
				$cnt++;
				?>
	 		 <?php
  			}while ($row_rs_gal = mysql_fetch_assoc($rs_gal)); 
	$parent=0;

		
  ?>
<?php
mysql_free_result($rs_gal);
?>
